<%@ include file="/common/taglibs.jsp"%>
<!--分页查询共用的页面-->
<%@ include file="/common/common.jsp"%>

<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">



<head>
<!---->
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css">
<script>
    $(function () {
        $("#tabs").tabs();

    });

    function loadPage(tabName,url){
        try {
            $("#"+tabName).load(url);
        } catch (error) {
            console.log(error);
        }
    }

    window.onload = function () {
        /*
        加载9个选项卡
        */
       //根目录
       var webPath = getRootPath_web()
       //车辆id
       var vehicleInfo = "?vehicleId=${vehicleId}";
       //地址列表
       var urls = new Array();

        //终端休眠唤醒模式 ，完成
        urls[0] = "<%=ApplicationPath%>/videoTerminalParam/viewWakeupModeParam.action" + vehicleInfo;
        $("#tabs-0-f").attr("src",urls[0]);
        //终端事件设置
        urls[1] = "<%=ApplicationPath%>/terminalEvent/view.action" + vehicleInfo;
        loadPage("tabs-1",urls[1]);
        //配置终端线路
        urls[2] = "<%=ApplicationPath%>/bindMapArea/viewBindRoute.action" + vehicleInfo;
        $("#tabs-2-f").attr("src",urls[2]);
        //设置电话本
        urls[3] = "<%=ApplicationPath%>/phoneBook/view.action" + vehicleInfo;
        $("#tabs-3-f").attr("src",urls[3]);
        //信息点播菜单设置
        urls[4] = "<%=ApplicationPath%>/terminalMenu/view.action" + vehicleInfo;
        $("#tabs-4-f").attr("src",urls[4]);
        //终端参数配置
        urls[5] = "<%=ApplicationPath%>/terminalParam/view.action" + vehicleInfo;
        $("#tabs-5-f").attr("src",urls[5]);
        
    };

    function getRootPath_web() {
      //获取当前网址，如： http://localhost:8083/uimcardprj/share/meun.jsp
      var curWwwPath = window.document.location.href;
      //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
      var pathName = window.document.location.pathname;
      var pos = curWwwPath.indexOf(pathName);
      //获取主机地址，如： http://localhost:8083
      var localhostPaht = curWwwPath.substring(0, pos);
      //获取带"/"的项目名，如：/uimcardprj
      var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
      return (localhostPaht + projectName);
    }

    function closeWindow(){
        $("body").stopTime();
        window.parent.closeCommandWindow();
    }
  </script>
</head>
<body>

    <div id="tabs" class="tab">
        <ul id="urls">
            <li><a href="#tabs-0">休眠唤醒模式设置</a></li>
            <li><a href="#tabs-1">终端事件设置</a></li>
            <li><a href="#tabs-2">终端线路设置</a></li>
            <li><a href="#tabs-3">电话本设置</a></li>
            <li><a href="#tabs-4">信息点播菜单设置</a></li>
            <li><a href="#tabs-5">终端参数设置</a></li>
        </ul>
        <div id="tabs-0"><!--休眠唤醒模式-->
                <iframe id="tabs-0-f" style="width:910px;height:420px;"></iframe>
        </div>
        <div id="tabs-1">
            <p>终端事件设置</p>
        </div>
        <div id="tabs-2"><!--终端线路设置-->
            <iframe id="tabs-2-f" style="width:910px;height:420px;"></iframe>
        </div>
        <div id="tabs-3">
            <iframe id="tabs-3-f" style="width:910px;height:420px;"></iframe>
        </div>
        <div id="tabs-4"><!--信息点播菜单设置-->
            <iframe id="tabs-4-f" style="width:910px;height:420px;"></iframe>
        </div>
        <div id="tabs-5"><!--终端参数设置-->
            <iframe id="tabs-5-f" style="width:910px;height:420px;"></iframe>
        </div>
    </div>
    <div>
        <p align="center" ><input type="button"  style="width:140px;height:25px;"  id="exitBtn" value="关闭" onclick="closeWindow();"/></p>
    </div>
    
</body>
</html>